<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jstl/fmt" %>
<%@ taglib uri="/WEB-INF/tld/security.tld" prefix="s" %>
<fmt:setBundle basename="messages"/>


<table width="50%" align="center" cellpadding="2" cellspacing="1" border="0" bgcolor="#CCCCC0">
	<tr>
		<td class="titulocolumna" align="center" width="5%">
			<c:if test="${not READ_ONLY}">
				<html:link action="/purchaseInstructionDetailAttachmentNew">
					<img alt="" src="images/nuevo.gif" border="0">
				</html:link>
			</c:if>
		</td>
		<td class="titulocolumna" align="center" width="85%">
			<fmt:message key="label.instructionattachment.description"/>
		</td>	
		<td class="titulocolumna" align="center" width="5%">
			<fmt:message key="label.instructionattachment.type"/>
		</td>	
		<td class="titulocolumna" align="center" width="5%">
			
		</td>		
	</tr>	
	<c:forEach items="${InstructionAttachmentForm.attachments}" var="attachment" varStatus="loop">
		<tr class='
		<c:choose>
		  <c:when test="${loop.index%2 == 0}"><c:out value="columnadatoPar" />
		  </c:when>
		<c:otherwise>
		  <c:out value="columnadatoNon" />
		</c:otherwise>
		</c:choose>'>
			<td>					
				<c:if test="${not READ_ONLY}">
					<a href="#>" onclick="location.href='purchaseInstructionDetailAttachmentEdit.do?attId=<bean:write name="attachment" property="instructionAttachmentId"/>';">
						<img  src="images/modificar.gif" border="0"/>
					</a>
				</c:if>
			</td>
			<td valign="top" align="center">			
				<c:out value="${attachment.description}" />
			</td>
			<td>	
				<a href="#>" onclick="location.href='exportToExcelFile.do?excelFile=<bean:write name="attachment" property="path"/>';">							
				 	<img width="20" height="20" src='images/file<c:out value="${attachment.fileExtension}" />.gif' border="0" ></img>
				</a>
			</td>
			<td>
				<c:if test="${not READ_ONLY}">
					<a href="#>" onclick="if(confirmDelete('<c:out value="${attachment.description}" />'))location.href='purchaseInstructionDetailAttachmentDelete.do?attId=<bean:write name="attachment" property="instructionAttachmentId"/>';">
						<img alt="<bean:message key="common.delete"/> <bean:write name="attachment" property="description"/>" src="images/eliminar.jpg" border="0">
					</a>	
				</c:if>
			</td>
		</tr>
	</c:forEach>
</table>
<br/>
<table align="center" width="50%" cellpadding="2" cellspacing="1" border="0" bgcolor="#CCCCC0">
	<tr>
		<td style="text-align: center; vertical-align: middle; width: 50%" class="columnadatoPar">
			<input type="button" name="backButton" value="<fmt:message key="label.common.cancel"/>" onclick="location.href = 'editInstructionPurchaseHeader.do'" class="boton"/> 
		</td>
	</tr>
</table>